package com.me.mynanogame;


import Screens.Negotiation;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class Renderer {
	public SpriteBatch sb;
	public OrthographicCamera cam;
	private static Renderer rend;
	
	
	public static Renderer getInstance(){
		if(rend == null){
			rend = new Renderer();
		}
		return rend;
	}
	
	private Renderer(){
		sb = new SpriteBatch();
		cam = new OrthographicCamera();
		cam.zoom = 900f/(float)Gdx.graphics.getHeight();
		cam.position.set(Gdx.graphics.getWidth()*cam.zoom/2,Gdx.graphics.getHeight()*cam.zoom/2,0);
		cam.viewportHeight = Gdx.graphics.getHeight();
		cam.viewportWidth = Gdx.graphics.getWidth();
		cam.update();
	}
	
	public void renderGame(Negotiation game){
		sb.begin();
		game.renderGame(sb);
		sb.end();
	}

}
